export default {
    pinlvFmt: (str) => {
        if (str === "day") {
            return "每天"
        } else if (str === "week") {
            return "每周"
        } else if (str === "month") {
            return "每月"
        } else {
            return "未知"
        }
    },
    timesFmt: (str) => {
        var strs = str.split(" ")
        return strs.join(":")
    },
    comTime: (created) => {
        if (created) {
            var now = new Date(created * 1000),
                y = now.getFullYear(),
                m = now.getMonth() + 1,
                d = now.getDate(),
                h = now.getHours(),
                m1 = now.getMinutes(),
                s = now.getSeconds()
            return y + "-" + (m < 10 ? "0" + m : m) + "-" + (d < 10 ? "0" + d : d) + " " + h + ":" + m1 + ":" + s
        }
    },
    StatusFormat: (status) => {
        if (status == 0) {
            return "成功"
        } else if (status == 2) {
            return "失败"
        } else if (status == 1) {
            return "正在执行"
        } else {
            return "未知"
        }
    },
    weeks: [
        { value: "1", label: "周一" },
        { value: "2", label: "周二" },
        { value: "3", label: "周三" },
        { value: "4", label: "周四" },
        { value: "5", label: "周五" },
        { value: "6", label: "周六" },
        { value: "0", label: "周日" },
    ],
    days: [
        { value: "1", label: "1" },
        { value: "2", label: "2" },
        { value: "3", label: "3" },
        { value: "4", label: "4" },
        { value: "5", label: "5" },
        { value: "6", label: "6" },
        { value: "7", label: "7" },
        { value: "8", label: "8" },
        { value: "9", label: "9" },
        { value: "10", label: "10" },
        { value: "11", label: "11" },
        { value: "12", label: "12" },
        { value: "13", label: "13" },
        { value: "14", label: "14" },
        { value: "15", label: "15" },
        { value: "16", label: "16" },
        { value: "17", label: "17" },
        { value: "18", label: "18" },
        { value: "19", label: "19" },
        { value: "20", label: "20" },
        { value: "21", label: "21" },
        { value: "22", label: "22" },
        { value: "23", label: "23" },
        { value: "24", label: "24" },
        { value: "25", label: "25" },
        { value: "26", label: "26" },
        { value: "27", label: "27" },
        { value: "28", label: "28" },
        { value: "29", label: "29" },
        { value: "30", label: "30" },
        { value: "31", label: "31" },
        { value: "L", label: "最后一天" },
    ],
    sqltypes: [
        { value: "mysql", label: "Mysql" },
        { value: "mssql", label: "Sql Server" },
        { value: "sqlite", label: "Sqlite3" },
        { value: "postgres", label: "Postgres" },
    ],
    chars: [
        { value: "utf8", label: "UTF-8" },
        { value: "gbk", label: "GBK" },
        { value: "gb3212", label: "GB2312" },
    ],
    pinlvs: [
        { value: "day", label: "天" },
        { value: "week", label: "周" },
        { value: "month", label: "月" },
    ],
}